<extend name="Public/base"/>



<block name="body">
    <div class="search-form fr cf" style="margin-bottom: 10px">
        <div class="sleft" style="background-color: inherit">
            <form method="get" action="{:U('Order/index','status='.$status)}" id="search">
                <input type="text" name="nickname" placeholder="下单用户昵称" class="search-input" style="margin-right: 20px">
                <input type="text" name="otid" placeholder="订单号" class="search-input" style="margin-right: 20px">
                <input type="submit" name="sub" placeholder="查询" class="btn" id="tj">
            </form>
        </div>
    </div>
    <!-- 数据列表 -->
    <div class="data-table">
        <div class="data-table table-striped">
            <table>
                <!-- 表头 -->
                <thead>
                <tr>
                    <th>订单号</th>
                    <th>用户昵称</th>
                    <th>订单状态时间</th>
                    <th>应付金额</th>
                    <th>订单状态</th>
                    <th>操作</th>
                </tr>

                </thead>



                <!-- 列表 -->

                <tbody>

                <volist name="orders" id="data">
                    <tr>
                        <td>{$data['out_trade_no']}</td>
                        <td>{$data['nickname']}</td>
                        <td>{$data['update_time']|time_format}</td>
                        <td>{$data['price']}</td>
                        <td>{$data['status']|get_order_status}</td>

                        <td><if condition="$data.status eq 2"><a class="ajax-get confirm" href="{:U('Order/finshorder','id='.$data['id'])}">完成</a></if>&nbsp;&nbsp;<a href="/Admin/think/lists/model/order_goods/oid/{$data['id']}">查看商品</a></td>
                    </tr>
                </volist>

                </tbody>

            </table>

        </div>

    </div>
    <div class="page">

        {$_page|default=''}

    </div>
<script>
    highlight_subnav('{:U('Order/index')}');
</script>
<if condition="$status eq 3">
    <script>
        function re(){
            window.location.href = "{:U('Order/index','status=3')}";
        }
        setInterval(re,30000);
    </script>
</if>
</block>


<block name="script">

    <script type="text/javascript">

        $(function(){
            //回车自动提交

            $('#tj').keyup(function(event){

                if(event.keyCode===13){

                    $("#search").click();

                }

            });

        })
    </script>

</block>